﻿using Sunny.UI;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace PanhuaWin.工厂.仓库.超级管理员
{
    public partial class 查看生产情况 : UIPage
    {
        public 查看生产情况()
        {
            InitializeComponent();
        }
        private void 查看生产情况_Load(object sender, EventArgs e)
        {
            uiDataGridView酸洗.AutoGenerateColumns = false;
            uiDataGridView镀锌.AutoGenerateColumns = false;
            uiDataGridView轧硬.AutoGenerateColumns = false;
            uiDataGridView彩涂.AutoGenerateColumns = false;
        }

        private void uiButton查询_Click(object sender, EventArgs e)
        {
            queryPickling();
            queryZin();
            queryHard();
            queryPaint();
        }

        //查询酸洗报工
        private void queryPickling() {
            string sql = @"SELECT '酸洗' 工序, OutputGuid, guid, Row 序号, OutputDate 生产日期, VolumeCodeNew 投入卷号, OutputVolumeNew 产出卷号, OutputSize 产出规格, 
                            OutputThick 产出厚度,OutputWidth 产出宽度, ProductWidth, OutputMaterial 产出材质, OutputWeight 产出重量, OutputMeter 产出长度, 
                            OutputQualityGrade 产出等级, OutputQualityInformation 质量信息, 
                            OutputEndStatus, OutputNext 去向, OutputAddress 产地, PrintTimes, DepartCode, DepartName , WorkLineCode, WorkLineName 产线名称, 
                            WorkTeamCode, WorkTeamName 班组名称, DayShiftCode, DayShiftName 班别, InventoryCode, InventoryName, FaceDone, FaceStatus, 
                            QualityStandard 执行标准, CreateID, Creator 报工人, CreateDate, ModifyID, Modifier, ModifyDate, Customer 客户
                            FROM Bus_PicklingOutput where VolumeCodeNew like '%" + uiTextBox卷号.Text.Trim() + "%'";
            DataTable dt = pub.GetDataTable(pub.ConnectionString,sql);
            uiDataGridView酸洗.DataSource = dt;
        }

        //查询镀锌
        private void queryZin()
        {
            string sql = @"SELECT '镀锌'工序, OutputGuid, guid, VolumeCodeNew 投入卷号, Row 序号, OutputDate 生产日期, OutputVolumeNew 产出卷号, OutputSize 产出规格, 
                            OutputThick 产出厚度, ZincThick 锌层厚度, 
                            OutputWidth 产出宽度, ProductWidth, OutputMaterial 产出材质, OutputWeight 产出重量, OutputMeter 产出长度,
                            OutputAddress 产地, OutputQualityGrade 产出等级, 
                            OutputQualityInformation 质量信息, OutputEndStatus, OutputNext 去向, PrintTimes, DepartCode, DepartName, WorkLineCode, 
                            WorkLineName 产线名称, WorkTeamCode, WorkTeamName 班组名称, DayShiftCode, DayShiftName 班别, InventoryCode, InventoryName, 
                            FaceDone 表面处理, FaceStatus 表面状态, QualityStandard 执行标准, CreateID, Creator 报工人, CreateDate, ModifyID, Modifier, ModifyDate, Customer 客户
                            FROM      Bus_ZincOutput where VolumeCodeNew like '%" + uiTextBox卷号.Text.Trim()+ "%'";
            DataTable dt = pub.GetDataTable(pub.ConnectionString, sql);
            uiDataGridView镀锌.DataSource = dt;

        }

        //轧硬
        private void queryHard()
        {
            string sql = @"SELECT  '轧硬' 工序, OutputGuid, guid, Row 序号, OutputDate 生产日期, VolumeCodeNew 投入卷号, OutputVolumeNew 产出卷号, OutputSize 产出规格,
                            OutputThick 产出厚度, 
                            OutputWidth 产出宽度, ProductWidth, OutputMaterial 产出材质, OutputWeight 产出重量, OutputMeter 产出长度, OutputAddress 产地
                            , OutputQualityGrade 产出等级, 
                            OutputQualityInformation 质量信息, OutputEndStatus, OutputNext 去向, PrintTimes, DepartCode, DepartName, WorkLineCode, 
                            WorkLineName 产线名称, WorkTeamCode, WorkTeamName 班组名称, DayShiftCode, DayShiftName 班别, InventoryCode, InventoryName, 
                            FaceDone, FaceStatus, QualityStandard 执行标准, CreateID, Creator 报工人, CreateDate, ModifyID, Modifier, ModifyDate, Customer 客户
                            FROM      Bus_HardOutput where VolumeCodeNew like '%" + uiTextBox卷号.Text.Trim() + "%'";
            DataTable dt = pub.GetDataTable(pub.ConnectionString, sql);
            uiDataGridView轧硬.DataSource = dt;
        }

        //彩涂
        private void queryPaint()
        {
            string sql = @"SELECT '彩涂' 工序,  OutputGuid, guid, Row 序号, OutputDate 生产日期, VolumeCodeNew 投入卷号, OutputVolumeNew 产出卷号, OutputSize 产出规格, 
                            OutputThick 产出厚度, 
                            OutputWidth 产出宽度, ProductWidth, OutputMaterial 产出材质, OutputWeight 产出重量, OutputMeter 产出长度, OutputAddress 产地, OutputColor 颜色, 
                            OutputQualityGrade 产出等级, OutputQualityInformation 质量信息, OutputEndStatus, OutputNext 去向, PrintTimes, DepartCode, DepartName, 
                            WorkLineCode, WorkLineName 产线名称, WorkTeamCode, WorkTeamName 班组名称, DayShiftCode, DayShiftName 班别, InventoryCode, 
                            InventoryName, FaceDone, FaceStatus, QualityStandard 执行标准, CreateID, Creator 报工人, CreateDate, ModifyID, Modifier, ModifyDate, 
                            Customer
                            FROM      Bus_PaintOutput where VolumeCodeNew like '%"+ uiTextBox卷号.Text.Trim() + "%'";
            DataTable dt = pub.GetDataTable(pub.ConnectionString,sql);
            uiDataGridView彩涂.DataSource = dt;
        }
    }
}
